﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Windows.Forms;
using WCFClientDemo.BankWCFService;

namespace WCFClientDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var client = new BankWCFService.FundTransfClient();
            int b = client.ChkBalance(1767, 78);
            label2.Text = "Current Balance is " + b;

            BankWCFService.Customer cs = new Customer();

            cs.CustId = 101;
            cs.Name = "Arun";
            cs.ContactNo = "+91818965356";

            try
            {
                client.AddCustomer(cs);
            }
            catch (FaultException<ServiceException> ex)
            {
                string title = ex.Detail.Title;
                string message = ex.Detail.Message;
                throw;
            }

            
            client.SaveCustomer(100, "Arun", "12/C Road");

            //client.SaveCustomer(111,"12/c r.u.lane","Sunil");

            BankWCFService.Customer cs2 = new Customer();
            string nm, addr;
            //int cutstId = client.GetCustDt(out nm, out addr, out cs2);

            int cst = client.GetCustDt(out addr,out nm);




        }
    }
}
